//
//  BaseView.m
//  NewNest
//
//  Created by hesiyao on 16/1/14.
//  Copyright © 2016年 www.lanou3g.com蓝鸥科技. All rights reserved.
//

#import "BaseView.h"

@implementation BaseView

- (void)dealloc
{
    [_titleLabel release];
    [_mainImg release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubviews];
    }
    return self;
}

/// 创建视图
- (void)createSubviews
{
    // 添加titleLabel
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 5, self.frame.size.width, self.frame.size.height / 9)];
    _titleLabel.font = [UIFont systemFontOfSize:13];
    [self addSubview:_titleLabel];
    [_titleLabel release];
    
    // 添加mainImg
    self.mainImg = [[UIImageView alloc] initWithFrame:CGRectMake(0, _titleLabel.frame.origin.y + _titleLabel.frame.size.height, self.frame.size.width, self.frame.size.height / 9 * 8)];
    _mainImg.contentMode = UIViewContentModeScaleAspectFill;
    _mainImg.clipsToBounds = YES;
    [self addSubview:_mainImg];
    [_mainImg release];
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
